package com.haoshuang.zhouzhoubang.ui.adapter


import android.graphics.Color
import com.chad.library.adapter4.BaseQuickAdapter
import com.haoshuang.zhouzhoubang.R
import com.haoshuang.zhouzhoubang.databinding.ItemTimecBinding
import com.haoshuang.zhouzhoubang.model.bean.TimeBean8
import com.mufeng.libs.base.BaseBindingHolder
import com.mufeng.libs.base.BaseBindingQuickAdapter

/**
 * 订单模块中的订单列表适配器
 * */
class TimeCheckAdapter(data: MutableList<TimeBean8>) :
    BaseBindingQuickAdapter<TimeBean8, ItemTimecBinding>(data) {

    override fun onBindViewHolder(holder: BaseBindingHolder, position: Int, item: TimeBean8?) {
        if (item == null) return
        val binding = ItemTimecBinding.bind(holder.itemView)
        binding.apply {
            if (item.isCheck == 0) {
                llB.setBackgroundResource(R.color.transparent)
                tvTime.setTextColor(Color.parseColor("#ffffff"))
                tvTime2.setTextColor(Color.parseColor("#ffffff"))
            } else {
                llB.setBackgroundResource(R.drawable.bg_8top2)
                tvTime.setTextColor(Color.parseColor("#00B7F5"))
                tvTime2.setTextColor(Color.parseColor("#00B7F5"))
            }
            tvTime.text = item.title
            tvTime2.text = item.date

        }
    }

}